import { createApp } from 'vue';
import App from './App.vue';
import router from './router'
import store from './store'

// @ts-ignore
import ActivityCalendar from "vue-activity-calendar";
import "vue-activity-calendar/style.css";
import Ctb from 'vue3-ctb'
// 引入组件样式
import 'vue3-ctb/contributes.css'

/* 编辑器 */
// @ts-ignore
import VueMarkdownEditor from '@kangc/v-md-editor';
import '@kangc/v-md-editor/lib/style/base-editor.css';
import vuepressTheme from '@kangc/v-md-editor/lib/theme/vuepress.js';
import '@kangc/v-md-editor/lib/theme/style/vuepress.css';
// @ts-ignore
import Prism from 'prismjs';
// 这是预览时引用的
// @ts-ignore
import VMdPreview from '@kangc/v-md-editor/lib/preview';
import '@kangc/v-md-editor/lib/style/preview.css';
// 引入你所使用的主题 此处以 github 主题为例
// @ts-ignore
import githubTheme from '@kangc/v-md-editor/lib/theme/github';
import '@kangc/v-md-editor/lib/theme/style/github.css';
// highlightjs
import hljs from 'highlight.js';



// @ts-ignore
import { align } from "@mdit/plugin-align";
// @ts-ignore
import { imgSize } from "@mdit/plugin-img-size";
// @ts-ignore
import { mark } from "@mdit/plugin-mark";
// @ts-ignore
import createEmojiPlugin from '@kangc/v-md-editor/lib/plugins/emoji/index';
// @ts-ignore
import createLineNumbertPlugin from '@kangc/v-md-editor/lib/plugins/line-number/index';
import '@kangc/v-md-editor/lib/plugins/emoji/emoji.css';
import createTodoListPlugin from '@kangc/v-md-editor/lib/plugins/todo-list/index';
import '@kangc/v-md-editor/lib/plugins/todo-list/todo-list.css';

//预览的主题
VMdPreview.use(vuepressTheme, {
    Hljs: hljs,
    extend(md:any) {
        md.use(align)
        md.use(imgSize)
    }
});
//编辑器的主题
VueMarkdownEditor.use(vuepressTheme, {
    Prism,
    extend(md:any) {
        md.use(align)
        md.use(imgSize)
        md.use(mark)
    }
});

VueMarkdownEditor.use(createEmojiPlugin()).use(createLineNumbertPlugin()).use(createTodoListPlugin())
VMdPreview.use(createLineNumbertPlugin())

//  引入ant-design-vue
import Antd from 'ant-design-vue';
import 'ant-design-vue/dist/reset.css';
import 'animate.css';

const app = createApp(App);

import "echarts"
import Echarts from 'vue-echarts';
app.component('v-chart',Echarts)

// 数字滚动组件
import CountTo  from 'vue3-count-to';
app.use(CountTo)

app.use(ActivityCalendar);
app.use(Ctb)

app.use(VMdPreview)
app.use(VueMarkdownEditor)

app.use(store).use(router).use(Antd).mount('#app')
